<?php $this->headLink()->appendStylesheet($this->Css('table.css')); ?>
<script>
$(document).ready(function(){
    $("#starType").change(function(){
        $("#starForm").submit();
     });
});
</script>
<style>
.newspaper-a {font-size:100%;margin: 5px auto; white-space: nowrap; text-align:center; width:98%}
.newspaper-a td ,.newspaper-a th {padding:10px;}
</style>
<form action="" method="post" name="starForm" id="starForm">
<table border="1" class="newspaper-a">
<thead>
<tr>
<th>
<select name="starType" id="starType">
<?php foreach($this->starStyle as $id=>$val):?>
<option value="<?php echo $id?>" <?php Sfs_Html::printSelected($id,$this->starType)?>><?php echo $this->translate($val)?></option>
<?php endforeach?>
</select>
<br />
<?php echo $this->translate('grade class')?>
</th>
<?php foreach($this->starArr as $name=>$id):?>
<th><?php echo $this->translate($name)?> <br/>
<?php $tempArr = explode("-",$id);?>
<?php echo $tempArr[0]?><br/>|<br/><?php echo $tempArr[1]?>
</th>
<?php endforeach;?>
<th><?php echo $this->translate('count')?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->className as $id=>$className):?>
<tr>
<td><?php echo $className?></td>
<?php $ci = 0;?>
<?php foreach($this->starArr as $name=>$val):?>
<td><?php echo (isset($this->data[$id][$val])) ?$this->data[$id][$val] : '&nbsp;'?></td>
<?php
if (isset ($this->data[$id][$val]))
$ci += $this->data[$id][$val] ;
?>
<?php endforeach;?>
<td><?php echo $ci?></td>
</tr>
<?php endforeach?>
<tr>
<td><?php echo $this->translate('total')?></td>
<?php $ci=0;?>
<?php foreach($this->starArr as $name=>$val):?>
<td><?php echo $this->monthTotal[$val]?></td>
<?php $ci += $this->monthTotal[$val]?>
<?php endforeach;?>
<td><?php echo $ci?></td>
</tr>

</tbody>
</table>
</form>